import Mock from 'mockjs';
export default {
    
    Uget() {
        let menu = Mock.mock({
            "total": 15,
            "pageTotal": 15,
            "page": 1,
            "pageSize": 1,
            "list": [
                {
                    "userId": 1,
                    "username": "11111111@QQ.com",
                    "password": "7fa8282ad93047a4d6fe6111c93b308a",
                    "alias": "law",
                    "type": 1
                },
                {
                    "userId": 2,
                    "username": "22222222@QQ.com",
                    "password": "qwraegsdasegt",
                    "alias": "names",
                    "type": 1
                },
            ]
        });

        Mock.mock("api/user/user/list", "get", () => {
            return menu;
        });
        
    },
    Uput(){
        let menu = Mock.mock({
            "total": 15,
            "pageTotal": 15,
            "page": 1,
            "pageSize": 1,
            "list": [
                {
                    "userId": 1,
                    "username": "11111111@QQ.com",
                    "password": "7fa8282ad93047a4d6fe6111c93b308a",
                    "alias": "law",
                    "type": 1
                }
            ]
        });

        Mock.mock("api/user/user/update", "put", () => {
            return 132 + menu;
        });
    },
    Dele(){
        let menu = Mock.mock({
            "total": 15,
            "pageTotal": 15,
            "page": 1,
            "pageSize": 1,
            "list": [
                {
                    "userId": 1,
                    "username": "11111111@QQ.com",
                    "password": "7fa8282ad93047a4d6fe6111c93b308a",
                    "alias": "law",
                    "type": 1
                }
            ]
        });

        Mock.mock("api/user/user/delete", "delete", () => {
            return 234 + menu;
        });
    },
    Jgets(){
        let menu = Mock.mock({
            "roleId":"1",
            "roleName":"管理员"
        });

        Mock.mock("api/user/role/list", "get", () => {
            return  menu;
        });
    },
    Jzhuche(){
        let menu = Mock.mock({
            "roleId":"1",
            "roleName":"管理员"
        });

        Mock.mock("api/user/user/register", "post", () => {
            return  354+menu;
        });
    },
    JuserId(){
        let menu = Mock.mock(
            [
                {
                    "RoleName": "管理员",
                    "roleId": 1
                },
                {
                    "RoleName": "老师",
                    "roleId": 2
                },
                {
                    "RoleName": "学生",
                    "roleId": 3,
                    "checked": true
                },
            ]
        );

        Mock.mock("api/user/user/register", "get", () => {
            return  menu;
        });
    }
}
